package edu.mtu.citizenscience.mushroommapper;

import android.annotation.SuppressLint;
import android.app.ListActivity;
import android.os.Build;
import android.os.Bundle;
import android.view.Menu;

import com.androidquery.AQuery;

import edu.mtu.citizenscience.mushroommapper.activity.R;
/**
 * @author Corbin Uselton <corbinu@cwuselto@mtu.edu>
 * @copyright (c) 2012 MichiganTech <http://www.mtu.edu>
 * @since 1.0
 * 
 * Base class for MMListActivity
 * imports android-query and adds menu
 */
public class MMListActivity extends ListActivity {
	// android-query library
	public AQuery aq;
	 
	/**
	 * MMListActivity creation handler
	 *
	 * @param   savedInstanceState - Bundle - Bundle with launch info
	 * @return  void
	 */
	@SuppressLint("NewApi")
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);
        
        // create the android-query library instance
        this.aq = new AQuery(this);
        
        // Make sure we're running on Honeycomb or higher to use ActionBar APIs
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) 
        {
        	// For the main activity, make sure the app icon in the action bar does not behave as a button
        	// since title bar is not visable the action bar does not exist and getActionBar returns null
        	//this.getActionBar().setHomeButtonEnabled(false);
        }
    }

	/**
	 * Create the android menu
	 *
	 * @param   menu - Menu - The options menu in which you place your items.
	 * @return  boolean - true as we want the menu to be displayed
	 */
    @Override
    public boolean onCreateOptionsMenu(Menu menu) 
    {
    	// inflate movie from xml file
        this.getMenuInflater().inflate(R.menu.mm_activity, menu);
        
        // return true to show menu
        return true;
    }
    
}
